#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    string s;
    cin >> n >> s;

    int total_y = 0;
    int current_n_length = 0;
    int ans = 0;

    for (char c : s)
    {
        if (c == 'n')
        {
            current_n_length++;
        }
        else
        {
            ans += current_n_length / 2;
            current_n_length = 0;
            total_y++;
        }
    }

    ans += current_n_length / 2;
    ans += total_y;

    cout << ans << endl;

    return 0;
}